package com.gome.ocean.server.oracle.common.db.rocketmq;

import java.io.Serializable;

/**
 * rocketMq配置文件
 * 
 * @author haqiaolong 2016年6月27日 下午5:41:05
 * @since 5.0.0
 */
public class RocketMqConfig implements Serializable {
    
    public RocketMqConfig(String topicName, String namesrvAddr, boolean serialize, String encode){
        super();
        this.topicName = topicName;
        this.namesrvAddr = namesrvAddr;
        this.serialize = serialize;
        this.encode = encode;
    }

    private String  topicName;

    private String  namesrvAddr;

    private boolean serialize;

    private String  encode;

    public String getTopicName() {
        return topicName;
    }

    public void setTopicName(String topicName) {
        this.topicName = topicName;
    }

    public String getNamesrvAddr() {
        return namesrvAddr;
    }

    public void setNamesrvAddr(String namesrvAddr) {
        this.namesrvAddr = namesrvAddr;
    }

    public boolean isSerialize() {
        return serialize;
    }

    public void setSerialize(boolean serialize) {
        this.serialize = serialize;
    }

    public String getEncode() {
        return encode;
    }

    public void setEncode(String encode) {
        this.encode = encode;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((encode == null) ? 0 : encode.hashCode());
        result = prime * result + ((namesrvAddr == null) ? 0 : namesrvAddr.hashCode());
        result = prime * result + (serialize ? 1231 : 1237);
        result = prime * result + ((topicName == null) ? 0 : topicName.hashCode());
        return result;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) return true;
        if (obj == null) return false;
        if (getClass() != obj.getClass()) return false;
        RocketMqConfig other = (RocketMqConfig) obj;
        if (encode == null) {
            if (other.encode != null) return false;
        } else if (!encode.equals(other.encode)) return false;
        if (namesrvAddr == null) {
            if (other.namesrvAddr != null) return false;
        } else if (!namesrvAddr.equals(other.namesrvAddr)) return false;
        if (serialize != other.serialize) return false;
        if (topicName == null) {
            if (other.topicName != null) return false;
        } else if (!topicName.equals(other.topicName)) return false;
        return true;
    }

}
